package com.hqq.behaviour.observer;

import com.hqq.behaviour.observer.generics.GHobbits;
import com.hqq.behaviour.observer.generics.GOrcs;
import com.hqq.behaviour.observer.generics.GWeather;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * App
 * Created by heqianqian on 2017/6/17.
 */
public class App {

    private static final Logger LOGGER = LoggerFactory.getLogger(App.class);

    public static void main(String[] args) {
        Weather weather = new Weather();
        weather.addObserver(new Orcs());
        weather.addObserver(new Hobbits());

        weather.timePassed();
        weather.timePassed();
        weather.timePassed();
        weather.timePassed();

        LOGGER.info("--Running generic version--");

        GWeather gWeather = new GWeather();
        gWeather.addObserver(new GOrcs());
        gWeather.addObserver(new GHobbits());

        gWeather.timePassed();
        gWeather.timePassed();
        gWeather.timePassed();
        gWeather.timePassed();

    }

}
